package com.hzit.model;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.List;

public class LayuiPage<T> {
    //前端查询需要的Json数据格式
    private Integer code = 0;
    private String msg = "";
    private Integer count;
    private List<T> data;

    //前端传过来的数据
    //当前页
    @JsonIgnore //这个字段不编译json格式
    private Integer page;
    //每页显示条数
    @JsonIgnore //这个字段不编译json格式
    private Integer limit;

    //sql 语句需要的数据
    @JsonIgnore
    private Integer start;

    @JsonIgnore
    private T t;

    public T getT() {
        return t;
    }

    public void setT(T t) {
        this.t = t;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    public Integer getStart() {
        return start;
    }

    public void setStart(Integer start) {
        this.start = start;
    }

    public LayuiPage(Integer code, String msg, Integer count, List<T> data, Integer page, Integer limit, Integer start) {
        this.code = code;
        this.msg = msg;
        this.count = count;
        this.data = data;
        this.page = page;
        this.limit = limit;
        this.start = start;
    }

    public LayuiPage() {
    }

    @Override
    public String toString() {
        return "LayuiPage{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", count=" + count +
                ", data=" + data +
                ", page=" + page +
                ", limit=" + limit +
                ", start=" + start +
                '}';
    }
}
